home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3102 < prev    next >
Encoding:
Text File  |  1996-08-06  |  2.0 KB  |  49 lines

  1. Newsgroups: comp.lang.c++
  2. Path: durham.org!stupy
  3. From: stupy@freenet.durham.org (Steve Tupy)
  4. Subject: Re: C++  Vs. C  & Efficiency
  5. X-Newsreader: TIN [version 1.2 PL2]
  6. Organization: Durham Free-Net
  7. Message-ID: <DLKKB4.Lqu@freenet.durham.org>
  8. References: <4d59ub$pfg@berlin.infomatch.com>
  9. Date: Mon, 22 Jan 1996 06:21:04 GMT
  10.  
  11. Edwin Tam (edwint@infomatch.com) wrote:
  12. : Hello,
  13.  
  14. : I have recently become proficient in C++ programming and was wondering about
  15. : the advantages of C++ vs C. One thing that has always sorta bugged me though
  16. : the question of the extra overhead required by C++ ( compiler wise ).
  17. : It seems as if every C++ programmer wants to 'object'ize every thing without
  18. : considering the overhead incurred by objects.
  19.  
  20.     Very seldom is this the case. A properly well written polymorphic
  21. heirarchy uses only what it needs, a poorly written one will duplicate data
  22. and hence memory all over the place. Proper data abstraction is and can be
  23. quite efficient. The use of virtual bases would apply to just such a case.
  24.  
  25. : Has anyone got any opinions or idea of the overhead imposed by C++?? 
  26. : A simple ponder : For every object instance, every variable of that class is 
  27. : duplicated... even if its not required. 
  28.  
  29. Managability comes to mind before overhead, but as I was saying,
  30. virtualizing is the answer. If you have only recently become proficient, and
  31. that interpretation can only be vague at best, perhaps you have not "caught"
  32. the message yet. Simply writing and deriving classes is definately not the
  33. heart of C++, polymorphism is... If you are using abstract base classes and
  34. deriving from virtual bases you are getting closer to the point...
  35.  
  36. You did ask for an opinion and this is but one of many you may recieve. C++
  37. can be as tight or as loose as the programmer makes it but isn't it
  38. wonderful that you have the choice? In "C" you cannot achieve this kind of
  39. power... sometimes you might have to actually sacrifice some memory for that
  40. power... something that is less and less of a problem as time goes on.
  41.  
  42. Take care!
  43.  
  44. Steve    
  45.  
  46.  
  47. -- 
  48. Steve
  49.